<template>
  <div>
    SSO LOGIN
  </div>
</template>

<script>
import {
  mapActions
} from 'vuex'
export default {

  components: {

  },
  data () {
    return {

    }
  },
  created () {
    if (this.$route.query.t) {
      this.SSOLogin(this.$route.query.t).then(res => {
        if (res.code == 0) {
          this.$router.replace({ name: 'dashboard' }, () => {
            this.$notification.success({
              message: '欢迎',
              description: `${timeFix()}，欢迎回来`
            })
          })
        } else {
          this.$router.replace({ path: '/user/login' })
        }
      })
    } else {
      this.$router.replace({ path: '/user/login' })
    }
  },
  methods: {
    ...mapActions(['SSOLogin'])
  }
}
</script>

<style lang="less" scoped>

</style>
